<template>
    <div class="classify">
        <h2>{{obj.Subject}}</h2>
        <div class="list">
            <el-dl v-for="(cItem,ind) in obj.Content" :key="ind"
                :icon="cItem.Icon"
                :label="cItem.Label"
                :type="cItem.Type"
                :subject="obj.Subject"
                :ind="ind"
                :activeInd="activeInd"
                @active="active"
                :class="{'border':obj.Layout==='border'}"
            ></el-dl>
        </div>
    </div>
</template>
<script>
// props 数组  对象

//默认值：数组和对象 必须用函数返回默认值
import elDl from './el-dl'
export default {
    // props:['obj'],
    components:{
        elDl
    },
    props:{
        obj:{
            type:Object,
            // required:true,  //是否必须要传
            default:function(){
                return {name:'lili'}
            }
        },
        index:{
            type:Number,
            required:false,
            default:1
        }
    },
    data(){
        return {
            activeInd:0
        }
    },
    methods:{
        choose(ind,type,subject){
            this.activeInd = ind;
            this.$emit('chooseFun',subject,type);
        },
        active(num){
            this.activeInd = num;
        }

    }
}
</script>
<style scoped lang="scss">
    .classify{
        width:100%;
        h2{
            font-size:16px;
        }
        .list{
            width:100%;
            display: flex;
            flex-wrap: wrap;
        }
    }
</style>
